<!DOCTYPE html>
<html class="x-admin-sm">

{include file="common/static" /}
{include file="common/resources" /}
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                
                <a>
                    <cite>房间优惠</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
                <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
            </a>
        </div>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body ">
                            <form class="layui-form layui-col-space5">
                                <div class="layui-input-inline layui-show-xs-block">
                                    <input class="layui-input" placeholder="开始日" name="start" id="start"></div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <input class="layui-input" placeholder="截止日" name="end" id="end"></div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <select name="contrller">
                                        <option>支付方式</option>
                                        <option>支付宝</option>
                                        <option>微信</option>
                                        <option>货到付款</option></select>
                                </div>

                                <div class="layui-input-inline layui-show-xs-block">
                                    <input type="text" name="username" placeholder="请输入订单号" autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <button class="layui-btn" lay-submit="" lay-filter="sreach">
                                        <i class="layui-icon">&#xe615;</i></button>
                                </div>
                            </form>
                        </div>
                        <div class="layui-card-body ">
                            <table class="layui-table layui-form" lay-skin="row">
                                <thead>
                                <tr>
                                    <th>房号</th>
                                    <th>类型</th>
                                    {volist name='week' id='w'}
                                    <th>{$w}</th>
                                    {/volist}
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                    {volist name='list' id='v'}
                                    <tr>
                                        <td>
                                            <img src="/static/ico/room_num.png"/>
                                            {$v.room_num}
                                        </td>
                                        <td>
                                            <img src="/static/ico/layout.png"/>
                                            {$v.type_name}
                                        </td>

                                        <td>
                                            <input type="text" lay-verify="required" id="monday{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.monday}">
                                        </td>
                                        <td>
                                            <input type="text" lay-verify="required" id="tuesday{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.tuesday}">
                                        </td>
                                        <td>
                                            <input type="text" lay-verify="required" id="wednesday{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.wednesday}">
                                        </td>
                                        <td>
                                            <input type="text" lay-verify="required" id="thursday{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.thursday}">
                                        </td>
                                        <td>
                                            <input type="text" lay-verify="required" id="friday{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.friday}">
                                        </td>
                                        <td>
                                            <input type="text" lay-verify="required" id="saturday{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.saturday}">
                                        </td>
                                        <td>
                                            <input type="text" lay-verify="required" id="sunday{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.sunday}">
                                        </td>

                                        <td>
                                            <input type="text" lay-verify="required" id="eight{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.eight}">
                                        </td>
                                        <td>
                                            <input type="text" lay-verify="required" id="nine{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.nine}">
                                        </td>
                                        <td>
                                            <input type="text" lay-verify="required" id="ten{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.ten}">
                                        </td>
                                        <td>
                                            <input type="text" lay-verify="required" id="eleven{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.eleven}">
                                        </td>
                                        <td>
                                            <input type="text" lay-verify="required" id="twelve{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.twelve}">
                                        </td>
                                        <td>
                                            <input type="text" lay-verify="required" id="thirteen{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.thirteen}">
                                        </td>
                                        <td>
                                            <input type="text" lay-verify="required" id="fourteen{$v.id}"
                                                   autocomplete="off" class="layui-input" value="{$v.fourteen}">
                                        </td>

                                        <td class="td-manage">
                                            <a title="查看" onclick="edits({$v.id})">
                                                <i class="layui-icon">&#xe63c;</i></a>
                                        </td>
                                    </tr>
                                    {/volist}
                                </tbody>
                            </table>
                            {$list|raw}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>

<script>

function edits(id){
    $.ajax({
        type:"post",
        url: "{:url('index/pricesystem/edits')}",
        data: {
            id:id,
            monday:$('#monday'+id).val(),
            tuesday:$('#tuesday'+id).val(),
            wednesday:$('#wednesday'+id).val(),
            thursday:$('#thursday'+id).val(),
            friday:$('#friday'+id).val(),
            saturday:$('#saturday'+id).val(),
            sunday:$('#sunday'+id).val(),
            eight:$('#eight'+id).val(),
            nine:$('#nine'+id).val(),
            ten:$('#ten'+id).val(),
            eleven:$('#eleven'+id).val(),
            twelve:$('#twelve'+id).val(),
            thirteen:$('#thirteen'+id).val(),
            fourteen:$('#fourteen'+id).val()
        },
        success: function(data){
            console.log(data);
            toastr.error(data.msg);
            if(data.code == 100){
                setTimeout(function () {
                    parent.location.reload();
                },1000);
            }
        }});
}


</script>

</html>